home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3658 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: noc.tor.hookup.net!news
  2. From: Richard Steadman <rsteadma@mmltd.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: The size of a file
  5. Date: 30 Jan 1996 15:56:47 GMT
  6. Organization: Micromedia
  7. Message-ID: <4elf3v$s5o@noc.tor.hookup.net>
  8. References: <4ebc03$4gv@gate.compart.fi> <59.28250.5782@windmill.com>
  9. NNTP-Posting-Host: keeper.mmltd.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. charlie.brown@windmill.com (Charlie Brown) wrote:
  16. >F>This is driving me nuts.  I can't find a simple way to get the size of a
  17. > >disk file.  This must be possible using the standard C library, but I
  18. > >haven't figured out how!
  19. >
  20. >This works with MSC, Borland may have a different name
  21. >for _dos_findfirst().
  22. >
  23. >#include <dos.h>
  24. >long fsize(filespec)
  25. >char *filespec;
  26. >{
  27. >        struct find_t fileinfo;
  28. >
  29. >        if(0 ==  _dos_findfirst(filespec,0,&fileinfo))
  30. >                return fileinfo.size;
  31. >        else
  32. >                return 0L;
  33. >}
  34. >---
  35.  
  36. But there's no way to get the file size if its length is greater
  37. than will fit in a long int?
  38.  
  39.  
  40.